package net.googlecode.demenkov.dao;

import java.io.Serializable;

/**
 * Generic DAO interface for actions with my entities
 *
 * @author Demenkov Yura
 */
public interface GenericDAO<T, ID extends Serializable> {
    /**
     * Updates entity in database
     *
     * @param entity to update
     */
    void update(final T entity);

    /**
     * Saves entity to database
     *
     * @param entity to save
     */
    void create(final T entity);

    /**
     * Deletes entity from database
     *
     * @param entity to delete
     */
    void delete(final T entity);

    /**
     * Gets entity with id
     *
     * @param id of entity
     * @return entity
     */
    T get(final ID id);
}
